<!--
  @author yangjiangming
  @date 2018/11/26 10:00
-->
<!DOCTYPE html SYSTEM "http://www.thymeleaf.org/dtd/xhtml1-strict-thymeleaf-4.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org">

<head>
    <title>批量新增厂商订单</title>

    <th:block th:replace="common/common :: jscss"/>
</head>

<style>
    .table-box {
        padding: 10px 30px;
    }
    .layui-table-cell {
        overflow: visible;
        height: 34px;
    }
    .layui-layer-content {
        overflow: visible !important;
    }
    .danger {
        border-color: #FF5722!important;
    }
    .content {
        padding: 60px 40px 40px 40px;
        text-align: center;
        font-size: 18px;
    }
</style>

<body>

<div class="layui-fluid new-order-page">
    <div class="layui-card">
        <form method="post" onkeydown="if(event.keyCode==13){return false}" action class="layui-form" lay-filter="zmn-order-add-form">

            <input type="hidden" name="longitude" id="longitude"/>
            <input type="hidden" name="latitude" id="latitude"/>
            <input type="hidden" id="district"/>
            <input type="hidden" name="channelId" id="channelId" lay-filter="channelId"/>

            <!--<div class="layui-card-header" style="margin-top:10px;"><b>基本信息</b></div>-->
            <div class="layui-split">&nbsp;</div>

            <div>
                <!-- title -->
                <!-- 厂商 -->
                <div class="layui-form-item">
                    <div class="layui-inline">
                        <label class="layui-form-label layui-form-required">厂商</label>
                        <div class="layui-input-inline" style="width: 410px;">
                            <select id="factoryId" name="factoryId" lay-verify="required" lay-filter="factory" lay-search>
                                <option value=""></option>
                                <option th:each="item : ${factoryList}"
                                        th:value="${item.value}"
                                        th:text="${item.text}"
                                        th:disabled="${item.disabled}">
                                </option>
                            </select>
                        </div>
                        <span class="layui-word-aux" style="line-height: 34px;">请按照下方格式要求，填写内容，一次最多批量下100单</span>
                    </div>
                </div>
                <div class="table-box">
                    <table id="formTable"></table>
                </div>


                <!-- 按钮 -->
                <div class="layui-form-item">
                    <div style="padding: 0 30px">
                        <div>
                            <button id="confirmbtn" type="button" class="layui-btn" lay-submit lay-filter="confirmbtn">保存</button>
                            <button type="button" class="layui-btn layui-btn-primary" id="uploadOrder" lay-filter="uploadOrder">导入Excel</button>
                            <span class="layui-word-aux">您也可以选择导入excel，进行批量下单</span>
                            <!--<button type="reset" class="layui-btn layui-btn-primary" >重置</button>-->
                        </div>
                    </div>
                </div>
                <div style="height: 1px"></div>
            </div>
        </form>
    </div>
</div>

<script th:inline="javascript">
    var json = {
        cityList: [[${cityList}]]
    };
    var plat = platMark.YEYX;

    var addOrderWebAk = [[${#baiduAkUtil.getAddOrderWebAk()}]];

    layui.config({
        base: "/static/js/module/",
        version: 20221013001
    }).extend({
        oms_order_factoryBatchAdd: "order/zmn.oms.order.factoryBatchAdd"
    }).use(['index', 'oms_order_factoryBatchAdd']);
</script>

<script type="text/html" id="userName">
        <input name="userName" class="name layui-input" maxlength="20" value="{{d.userName !== undefined ? d.userName : ''}}">
</script>

<script type="text/html" id="telephone">
    <input name="telephone" class="telephone layui-input {{d.telephoneFlag === false ? 'danger' : ''}}" lay-verify="tel" value="{{d.telephone !== undefined ? d.telephone : ''}}">
</script>

<script type="text/html" id="telephone2">
    <input name="telephone2" class="telephone layui-input" lay-verify="tel"  >
</script>

<script type="text/html" id="bizType">
    <select name="bizType" lay-search>
        <option th:each="item : ${bizTypeList}" th:value="${item.value}" th:text="${item.text}" th:selected="${ item.value == 2 }"></option>
    </select>
</script>

<script type="text/html" id="count">
    <input name="count" class="layui-input {{d.countFlag === false ? 'danger' : ''}}"  lay-verify="count" value="{{d.count !== undefined ? d.count : ''}}">
</script>

<script type="text/html" id="city">
    <select name="city" lay-filter="city" lay-search >
        <option value="">全部</option>
        <option th:each="item : ${cityList}" th:value="${item.value}" th:text="${item.text}"></option>
    </select>
</script>

<script type="text/html" id="street">
    <input name="street" class="layui-input" lay-verify="maxLenTo50" value="{{d.street !== undefined ? d.street : ''}}">
</script>

<script type="text/html" id="address">
    <input name="address" class="layui-input {{d.addressFlag === false ? 'danger' : ''}}" lay-verify="maxLenTo50" value="{{d.address !== undefined ? d.address : ''}}">
</script>

<script type="text/html" id="dutyTime">
<div style="width: 45%;display: inline-block">
    <input class="layui-input date" id="date-{{d.LAY_TABLE_INDEX}}" name="date" lay-filter="date" placeholder="请选择日期"/>
</div>
<div style="width: 30%;display: inline-block">
    <select name="hour" id="hour-{{d.LAY_TABLE_INDEX}}" lay-filter="hour" lay-search> </select>
</div>
<div style="width: 20%;display: inline-block">
    <select name="minute" id="minute-{{d.LAY_TABLE_INDEX}}" lay-filter="minute" lay-search placeholder="分">
        <option value="">分</option>
        <option value="00">00</option>
        <option value="30">30</option>
    </select>
</div>
</script>

<script type="text/html" id="remark">
    <textarea name="remark" class="layui-input" lay-verify="maxLenTo1000"  value="{{d.remark !== undefined ? d.remark : ''}}"/>
</script>

<script type="text/html" id="fault">
    <textarea name="fault" class="layui-input" lay-verify="maxLenTo1000"/>
</script>


<!-- 城市 -->
<script type="text/html" id="remoteSelectForCityTemplate">
    <select class="select-city-remote" id="city" name="city" lay-filter="city" lay-ignore style="width: 100%;" disabled>
        <option value="">请选择</option>
    </select>
</script>

<!-- 城市 -->
<script type="text/html" id="remoteSelectForCountyTemplate">
    <select class="select-city-remote county" id="county" name="county" lay-filter="county" lay-ignore style="width: 100%;" disabled>
        <option value="">请选择</option>
    </select>
</script>

<!-- 产品 -->
<script type="text/html" id="remoteSelectForProductTemplate">
    <select class="select-product-remote" id="product" name="product" lay-filter="product" lay-ignore style="width: 100%;" disabled="">
        <option value="">请选择</option>
    </select>
</script>

<script type="text/html" id="batchUpload">

    <div class="layui-form">
        <div class="layui-form-item" style="padding: 10px 0">
            <div class="layui-inline">
                <label class="layui-form-label layui-form-required">厂商</label>
                <div class="layui-input-inline" style="width: 410px;">
                    <select id="factoryIdForUpload" name="factoryIdForUpload" lay-verify="required"
                            lay-filter="factoryIdForUpload" lay-search>
                        <option value=""></option>
                        <option th:each="item : ${factoryList}"
                                th:value="${item.value}"
                                th:text="${item.text}"
                                th:disabled="${item.disabled}">
                        </option>
                    </select>
                </div>
            </div>
        </div>

        <div class="layui-form-item">
            <div class="layui-inline">
                <label class="layui-form-label layui-form-required">上传Excel</label>
                <button type="button" class="layui-btn layui-btn-normal" id="chooseFile">选择文件</button>
                <a href="/static/excelTemplates/厂商批量下单excel模板.xlsx">下载模板</a>
            </div>
        </div>
        <div class="layui-form-item">
            <div class="layui-upload">
                <label class="layui-form-label"></label>
                <button type="button" class="layui-btn" id="confirmUpload">提交</button>
            </div>
        </div>
        <div id="progressBar" class="layui-progress layui-progress-big layui-hide" lay-showpercent="true" lay-filter="importProgressBar" style="margin: 10px 30px;">
            <div class="layui-progress-bar layui-bg-green" lay-percent="0%"></div>
        </div>
    </div>
</script>

</body>
</html>